/*
 * 
 * Copyright 2010 David H Pollack
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License. 
 * 
 * 
 */

package com.dhpollack.rotogss.data;

import java.util.Date;
import java.util.List;
import java.util.Set;

import javax.jdo.annotations.Element;
import javax.jdo.annotations.Extension;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;

/**
 * @author davidpl
 *
 */
@PersistenceCapable
public class YahooLeagues {
	
    @PrimaryKey
    @Persistent
    private Key leagueKey;
    
    @Persistent
    private YahooGames gamekey;

    @Persistent
    private Integer leagueId;

    @Persistent
    private String leagueName;

    @Persistent
    @Extension(vendorName = "datanucleus", key = "gae.unindexed", value="true")
    private String leagueUrl;

    @Persistent
    private String draftStatus;

    @Persistent
    private Integer numTeams;
    
    @Persistent
    private Date leagueUpdateTimestamp;
    
    @Persistent
    private String draftType;
    
    @Persistent
    private String scoringType;

    @Persistent
    private Integer usesPlayoff;

    @Persistent
    private Integer usesFaab;
    
    @Persistent
    private List<Key> leagueStats;
    
    @Persistent
    private List<Key> draftResults;
    
    @Persistent
    private Set<Key> googleUsers;

    @Persistent(mappedBy = "leaguekey")
    @Element(dependent = "true")
    private Set<YahooLeagueRosterPositions> yahooLeagueRosterPositions;
    
    @Persistent(mappedBy = "leaguekey")
    @Element(dependent = "true")
    private Set<YahooLeagueTeams> yahooLeagueTeams;

	public Key getLeagueKey() {
		return leagueKey;
	}

	public void setLeagueKey(Key leagueKey) {
		this.leagueKey = leagueKey;
	}

	public Integer getLeagueId() {
		return leagueId;
	}

	public void setLeagueId(Integer leagueId) {
		this.leagueId = leagueId;
	}

	public String getLeagueName() {
		return leagueName;
	}

	public void setLeagueName(String leagueName) {
		this.leagueName = leagueName;
	}

	public String getLeagueUrl() {
		return leagueUrl;
	}

	public void setLeagueUrl(String leagueUrl) {
		this.leagueUrl = leagueUrl;
	}

	public String getDraftStatus() {
		return draftStatus;
	}

	public void setDraftStatus(String draftStatus) {
		this.draftStatus = draftStatus;
	}

	public Integer getNumTeams() {
		return numTeams;
	}

	public void setNumTeams(Integer numTeams) {
		this.numTeams = numTeams;
	}

	public Date getLeagueUpdateTimestamp() {
		return leagueUpdateTimestamp;
	}

	public void setLeagueUpdateTimestamp(Date leagueUpdateTimestamp) {
		this.leagueUpdateTimestamp = leagueUpdateTimestamp;
	}

	public String getDraftType() {
		return draftType;
	}

	public void setDraftType(String draftType) {
		this.draftType = draftType;
	}

	public String getScoringType() {
		return scoringType;
	}

	public void setScoringType(String scoringType) {
		this.scoringType = scoringType;
	}

	public Integer getUsesPlayoff() {
		return usesPlayoff;
	}

	public void setUsesPlayoff(Integer usesPlayoff) {
		this.usesPlayoff = usesPlayoff;
	}

	public Integer getUsesFaab() {
		return usesFaab;
	}

	public void setUsesFaab(Integer usesFaab) {
		this.usesFaab = usesFaab;
	}

	public List<Key> getLeagueStats() {
		return leagueStats;
	}

	public void setLeagueStats(List<Key> leagueStats) {
		this.leagueStats = leagueStats;
	}

	public void addLeagueStats(Key leagueStat) {
		this.leagueStats.add(leagueStat);
	}

	public void addLeagueStats(List<Key> leagueStats) {
		this.leagueStats.addAll(leagueStats);
	}

	public List<Key> getDraftResults() {
		return draftResults;
	}

	public void setDraftResults(List<Key> draftResults) {
		this.draftResults = draftResults;
	}

	public Set<Key> getGoogleUsers() {
		return googleUsers;
	}

	public void setGoogleUsers(Set<Key> googleUsers) {
		this.googleUsers = googleUsers;
	}

	public void addGoogleUser(Key googleUser) {
		this.googleUsers.add(googleUser);
	}

	public void removeGoogleUser(Key googleUser) {
		this.googleUsers.remove(googleUser);
	}

	public Set<YahooLeagueRosterPositions> getYahooLeagueRosterPositions() {
		return yahooLeagueRosterPositions;
	}

	public void setYahooLeagueRosterPositions(
			Set<YahooLeagueRosterPositions> yahooLeagueRosterPositions) {
		this.yahooLeagueRosterPositions = yahooLeagueRosterPositions;
	}

	public Set<YahooLeagueTeams> getYahooLeagueTeams() {
		return yahooLeagueTeams;
	}

	public void setYahooLeagueTeams(Set<YahooLeagueTeams> yahooLeagueTeams) {
		this.yahooLeagueTeams = yahooLeagueTeams;
	}

	public void addYahooLeagueTeams(YahooLeagueTeams yahooLeagueTeam) {
		this.yahooLeagueTeams.add(yahooLeagueTeam);
	}

	public void removeYahooLeagueTeams(YahooLeagueTeams yahooLeagueTeam) {
		this.yahooLeagueTeams.remove(yahooLeagueTeam);
	}

	public YahooGames getYahooGames() {
		return gamekey;
	}
   

}
